package com.yangbo.controller;

import com.yangbo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author Administrator
 * @Date 2018-10-15 10:05
 */
@RestController
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping(value = "/user/{name}")
    public ResponseEntity<Map<String,Object>> getUser(@PathVariable(value = "name") String name) {
        return ResponseEntity.ok().body(userService.getUser(name));
    }
}
